package com.rbac.admin.entity.system;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.rbac.admin.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 用户实体类
 *
 * @author rbac-admin
 * @since 2024-07-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
@Schema(description = "用户实体")
public class SystemUser extends BaseEntity {

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "性别：0-未知，1-男，2-女")
    private Integer sex;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "状态：0-禁用，1-正常")
    private Integer status;

    @Schema(description = "主部门ID")
    private String mainDeptId;

    @TableField(exist = false)
    @Schema(description = "备注")
    private String remark;

    @TableField(exist = false)
    @Schema(description = "最后登录IP")
    private String lastLoginIp;

    @TableField(exist = false)
    @Schema(description = "最后登录时间")
    private LocalDateTime lastLoginTime;

    @TableField(exist = false)
    @Schema(description = "部门名称")
    private String deptName;
}